﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace OffInvoiceExcelTemplate
{
    public static class Loader
    {

        /// <summary>
        /// Carga la etiqueta correspondiente a cada control, segun su tag.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        public static string LoadLabel(string path, string tag)
        {
            string label = " ";
            try
            {
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.Load(path);
                string lb = xmldoc.GetElementsByTagName(tag).Item(0).InnerText;
                if (!string.IsNullOrEmpty(lb))
                    label = lb;

                return label;

            }
            catch (Exception)
            {
                return label;
            }
        }


    }
}
